/*
 * heurAlgV.h
 *
 *  Created on: 30-09-2011
 *      Author: pawel
 */

#ifndef HEURALGV_H_
#define HEURALGV_H_
#include"../algorithms.h"
#include<memory>
class seqFeederList;
class seqFeeder;
/**
 * This class implements Interface for implementing heuristic algorithms
 */
class heurAlgV{
protected:
	optAlgThreadParam optAlgThParam;
	size_t heurThreads;
	size_t optThreads;
	std::auto_ptr<seqFeederList> listFeederPtr;
	seqFeeder *mainSeqFeederPtr;
	/*
	 * Method implements heuristic algorithm thread
	 */
	virtual void* runThread()=0;
	/*
	 * This method can be used to start heuristic algorithm thread
	 * Non static function can not be used to start thread from pthreads library
	 * @param void casted pointer to heurAlgV
	 */
	static void* heurThreadEntry(void* param);
	/**
	 * This method starts heuristic and optimal threads.
	 *
	 */
	static void startThreads(heurAlgV *heurAlg);
public:
	heurAlgV(const optAlgThreadParam &optAlgParam,size_t heurThreads,size_t optThreads);
	virtual ~heurAlgV()=0;
	/*
	 * This method starts computation process
	 */
	virtual void runAlg()=0;

};




#endif /* HEURALGV_H_ */
